<?php defined('SYSPATH') OR die('No direct access allowed.'); ?>
<script type="text/javascript">
$(document).ready(function() {
	$("input[name='btnAdd']").click(function() {
		var uri = ISS.lang.getBasePath()+'index.php/channel/index/add';
		window.location = uri;
	});

	$(".pagination a").click(function() {
		var uri = $(this).attr('href'); 
		ISS.Ajax.Caller.request(uri, null);		
		return false;
	});

	$(".actionDel").click(function() {
		if (confirm('คุณต้องการลบ ใช่หรือไม่?')) {
			var uri = $(this).attr('href'); 
			ISS.Ajax.Caller.request(uri, null);	
		}	
		return false;
	});
}); 
</script>
<?php
echo html::Stylesheet(
array
(
			'media/css/gene_block.css',
),
array
(
			'screen',
)
);
?>

<div id="mainCont">
<h3>รายการสถานีเพลง</h3>
<table>
	<tr>
		<th>ชื่อสถานีเพลง</th>
		<th>รายละเอียด</th>
		<th>คำสั่ง</th>
	</tr>
	<?php
	$i = 0;
	foreach ($channels as $item):
	$i++;
	echo (($i % 2)==0) ? '<tr class="geneListDark">' : '<tr class="geneListLight">';
	?>
	<td><?php echo html::specialchars($item['title']); ?></td>
	<td><?php echo html::specialchars($item['description']); ?></td>
	<td><a class='actionEdit'
		href="<?php echo url::base(); ?>/index.php/channel/channels_playlists/detail/<?php echo $item['id']; ?>"><img
		alt="ดู" src="<?php echo url::base();?>/media/images/edit.png"
		border="0" /></a></td>
	</tr>
	<?php endforeach ?>
</table>

	<?php echo $pagination ?></div>
